package com.ruoyi.local.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.local.domain.SysAppmenu;
import com.ruoyi.local.service.ISysAppmenuService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/local/3Dearth/appindex")
public class AppmenuController extends BaseController {

    private String prefix = "local/3Dearth/";

    @Autowired
    private ISysAppmenuService sysAppmenuService;

    @RequiresPermissions("local:appmenu:view")
    @GetMapping()
    public String appmenu()
    {
        return prefix + "index";
    }

    /**
     * 查询APP菜单权限树列表
     */
    @RequiresPermissions("local:appmenu:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(SysAppmenu sysAppmenu)
    {
        List<SysAppmenu> list = sysAppmenuService.selectSysAppmenuList(sysAppmenu);
        return getDataTable(list);
    }
}
